import gzip
import json
import time
import uuid
import datetime
import requests
import hashlib
import hmac
from utiles.log import logger


def my_md5(encrypt_data) -> str:
    """
    md5摘要算法加密
    :return:
    """
    obj = hashlib.md5()
    obj.update(encrypt_data.encode('utf-8'))
    res = obj.hexdigest()
    return res


def get_current_timestamp13():
    """
    获取13位数时间戳
    :return:
    """
    return "{}".format(int(time.time() * 1e3))


def dumps(data_dict):
    """
    字典数据序列化
    :return:
    """
    return json.dumps(data_dict, separators=(',', ':'))